/***********************************************************************
 * POJO Class :  SysMenuResource.java
 * Author:  Bill Vison
 * Purpose: Defines the Class SysMenuResource
 ***********************************************************************/

package org.vsg.security.model.domain;

import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@javax.persistence.Entity
@javax.persistence.Table(name = "menu_resource")
@PrimaryKeyJoinColumn(name="ID_RESOURCE")
public class SysMenuResource extends SysResource {


	
	private static final short TYPE = 1;
	 
	@Column(name ="FLAG_STRATEGY")
	private short flagStrategy;
	 
	@OneToOne(cascade = javax.persistence.CascadeType.ALL)
	@JoinColumn(name="asso_id_resource")	
	private SysResource associationResource;
	 
	@Column(name ="FLAG_DISABLED")
	private short flagDisabled;
	 
	@Column(name ="ID_PARENT")
	private long parentId = 0;
	

	public SysMenuResource() {
		this.flagType = TYPE;
	}
	
	/**
	 * @param newFlagStrategy
	 */	
	public void setFlagStrategy(short newFlagStrategy) {
		flagStrategy = newFlagStrategy;
	}
	
	public short getFlagStrategy() {
		return flagStrategy;
	}	
	
	/**
	 * @param newAssociationResource
	 */	
	public void setAssociationResource(SysResource newAssociationResource) {
		associationResource = newAssociationResource;
	}
	
	public SysResource getAssociationResource() {
		return associationResource;
	}	
	
	/**
	 * @param newFlagDisabled
	 */	
	public void setFlagDisabled(short newFlagDisabled) {
		flagDisabled = newFlagDisabled;
	}
	
	public short getFlagDisabled() {
		return flagDisabled;
	}	
	
	/**
	 * @param newParentId
	 */	
	public void setParentId(long newParentId) {
		parentId = newParentId;
	}
	
	public long getParentId() {
		return parentId;
	}	


}